/*
 * Text.h
 *
 *  Created on: 04/03/2013
 *      Author: http://content.gpwiki.org/index.php/SDL_ttf:Tutorials:Basic_Font_Rendering
 */

#ifndef TEXT_H_
#define TEXT_H_

#include "core/GameComponent.h"
#include "component/Doodle.h"

#include "SDL/SDL_ttf.h"
#include "util/EatsVars.h"

using namespace eats_vars;
using namespace eats_core;

class Text: public eats_core::GameComponent {
public:
	Text(SDL_Surface * workingSurface, string fontPath, int fontSize, string * textToWrite, Point * position);
	virtual ~Text();

	bool render();
	bool update();
	bool tearDown();
	bool setUp();

	enum Textquality {solid, blended};

	TTF_Font* loadfont(const char* file, int ptsize);
	SDL_Surface * drawtext(TTF_Font * fontTodraw, Color * fontColor,const char text[], Textquality quality);

	TTF_Font * _font;

	SDL_Surface * _glyph;
	SDL_Surface * _workingSurface;

	Color * _color;
	Point * _position;

	string _fontPath;
	string * _textToWrite;

	string getNullImg() {
		return "/opt/attacks/resources/__null_img.png";
	}

	int _fontSize;

};

#endif /* TEXT_H_ */
